package per.zhang.vaccinesys.serverConsumer.dto.respone;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.beanutils.PropertyUtils;
import per.zhang.vaccinesys.serverConsumer.base.dto.BaseDTO;
import per.zhang.vaccinesys.serverConsumer.entity.Vaccine;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;

/**
 * @auther zhang
 * @ TO DO
 * @creatTime 2021/1/25 16:13
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VaccineRespondDTO extends BaseDTO {

    /**
     * 疫苗id
     */
    private Integer vaccineId;

    /**
     * 疫苗名字
     */
    private String vaccineName;


    /**
     * 疫苗状态：可接种，可预约，余量不足
     */
    private String state;

    /**
     * 已预约数量，不能大于疫苗剩余量
     */
    private Integer  appointmentNum;

    public VaccineRespondDTO(Vaccine vaccine) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        PropertyUtils.copyProperties(this, vaccine);
    }
}
